package jp.eisbahn.mgapi.auth;

import javax.servlet.http.HttpServletResponse;

public class Token {

    private boolean success;
    private String refreshToken;
    private String accessToken;
    private long expiresIn;
    private int statusCode;
    private String statusMessage;
    
    public Token(String refreshToken, String accessToken, long expiresIn) {
        super();
        success = true;
        this.refreshToken = refreshToken;
        this.accessToken = accessToken;
        this.expiresIn = expiresIn;
        statusCode = HttpServletResponse.SC_OK;
        statusMessage = "OK";
    }
    
    public Token(int statusCode, String message) {
        super();
        success = false;
        this.statusCode = statusCode;
        this.statusMessage = message;
    }

    public String getRefreshToken() {
        return refreshToken;
    }
    
    public String getAccessToken() {
        return accessToken;
    }
    
    public long getExpiresIn() {
        return expiresIn;
    }
    
    public boolean isSuccess() {
        return success;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getStatusMessage() {
        return statusMessage;
    }

    @Override
    public String toString() {
        return "Token [success=" + success + ", refreshToken=" + refreshToken
                + ", accessToken=" + accessToken + ", expiresIn=" + expiresIn
                + ", statusCode=" + statusCode + ", statusMessage="
                + statusMessage + "]";
    }
    
}
